package com.fxhy.utils;

import java.util.UUID;

public class CommonUtils {
	//获取uuid
	public static String getUuid() {
		return UUID.randomUUID().toString().replace("-", "");
	}
	
	public static String getRandomString(int length) {
	    //随机字符串的随机字符库
	    //String KeyString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
		String KeyString = "0123456789";
	    StringBuffer sb = new StringBuffer();
	    int len = KeyString.length();
	    for (int i = 0; i < length; i++) {
	       sb.append(KeyString.charAt((int) Math.round(Math.random() * (len - 1))));
	    }
	    return sb.toString();
	}
}
